package com.taotao.index.webservice;

import javax.jws.WebService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.taotao.common.pojo.TaotaoResult;
import com.taotao.index.service.ItemService;
@Component
@WebService(serviceName="SolrWebService", endpointInterface="com.taotao.index.webservice.SolrWebService")
public class SolrWebServiceImpl implements SolrWebService {
	@Autowired
	private ItemService itemService;
	@Override
	public TaotaoResult createIndex() {
		// TODO Auto-generated method stub
		try {
			return itemService.importSolr();
		} catch (Exception e) {
			return TaotaoResult.build(500, e.getMessage());
		} 
	}

}
